package org.shiwen.week7;

public class Animal {
    private String name;
    private int age;
    private String sex;

    public Animal(String name, int age, String sex) {
        this.name = name;
        this.age = age;
        this.sex = sex;
    }

    public Animal() {}

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public void eat() {
        System.out.println("吃吃吃");
    }

    void showinfo(){
        System.out.println("名字：" + name + " 年龄：" + age + " 性别：" + sex);
    }

    protected void showinfo2(){
        System.out.println("名字：" + name + " 年龄：" + age + " 性别：" + sex);
    }

    public Dog getDog(){
        Dog dog = new Dog();
        return dog;
    }
}
